package com.booking.springrestful.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户上传纹样审核流程表
 * @TableName pattern_upload_review
 */
@TableName(value ="pattern_upload_review")
@Data
public class PatternUploadReview implements Serializable {
    /**
     * 审核记录唯一ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 提交上传的用户ID（关联 users.userId）
     */
    private Integer userId;

    /**
     * 
     */
    private Date uploadTime;

    /**
     * 用户填写的纹样名称
     */
    private String name;

    /**
     * 纹样类型
     */
    private String type;

    /**
     * 所属地域
     */
    private String region;

    /**
     * 工艺难度
     */
    private Object difficultyLevel;

    /**
     * 文化寓意
     */
    private String culturalMeaning;

    /**
     * 历史背景描述
     */
    private String historicalBackground;

    /**
     * 工艺流程说明
     */
    private String craftProcess;

    /**
     * 用户上传的原始文件路径
     */
    private String uploadedFilePath;

    /**
     * 
     */
    private Object reviewStatus;

    /**
     * 审核管理员的用户ID（关联 users.userId）
     */
    private Integer reviewerId;

    /**
     * 审核完成时间
     */
    private Date reviewTime;

    /**
     * 若驳回，填写原因
     */
    private String rejectionReason;

    /**
     * 若审核通过，对应 pattern_library.id
     */
    private Long approvedPatternId;

    /**
     * 
     */
    private Date createdAt;

    /**
     * 
     */
    private Date updatedAt;

    /**
     * 该纹样在构图中的功能角色
     */
    private Object patternRole;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PatternUploadReview other = (PatternUploadReview) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getUploadTime() == null ? other.getUploadTime() == null : this.getUploadTime().equals(other.getUploadTime()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getRegion() == null ? other.getRegion() == null : this.getRegion().equals(other.getRegion()))
            && (this.getDifficultyLevel() == null ? other.getDifficultyLevel() == null : this.getDifficultyLevel().equals(other.getDifficultyLevel()))
            && (this.getCulturalMeaning() == null ? other.getCulturalMeaning() == null : this.getCulturalMeaning().equals(other.getCulturalMeaning()))
            && (this.getHistoricalBackground() == null ? other.getHistoricalBackground() == null : this.getHistoricalBackground().equals(other.getHistoricalBackground()))
            && (this.getCraftProcess() == null ? other.getCraftProcess() == null : this.getCraftProcess().equals(other.getCraftProcess()))
            && (this.getUploadedFilePath() == null ? other.getUploadedFilePath() == null : this.getUploadedFilePath().equals(other.getUploadedFilePath()))
            && (this.getReviewStatus() == null ? other.getReviewStatus() == null : this.getReviewStatus().equals(other.getReviewStatus()))
            && (this.getReviewerId() == null ? other.getReviewerId() == null : this.getReviewerId().equals(other.getReviewerId()))
            && (this.getReviewTime() == null ? other.getReviewTime() == null : this.getReviewTime().equals(other.getReviewTime()))
            && (this.getRejectionReason() == null ? other.getRejectionReason() == null : this.getRejectionReason().equals(other.getRejectionReason()))
            && (this.getApprovedPatternId() == null ? other.getApprovedPatternId() == null : this.getApprovedPatternId().equals(other.getApprovedPatternId()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
            && (this.getPatternRole() == null ? other.getPatternRole() == null : this.getPatternRole().equals(other.getPatternRole()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getUploadTime() == null) ? 0 : getUploadTime().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getRegion() == null) ? 0 : getRegion().hashCode());
        result = prime * result + ((getDifficultyLevel() == null) ? 0 : getDifficultyLevel().hashCode());
        result = prime * result + ((getCulturalMeaning() == null) ? 0 : getCulturalMeaning().hashCode());
        result = prime * result + ((getHistoricalBackground() == null) ? 0 : getHistoricalBackground().hashCode());
        result = prime * result + ((getCraftProcess() == null) ? 0 : getCraftProcess().hashCode());
        result = prime * result + ((getUploadedFilePath() == null) ? 0 : getUploadedFilePath().hashCode());
        result = prime * result + ((getReviewStatus() == null) ? 0 : getReviewStatus().hashCode());
        result = prime * result + ((getReviewerId() == null) ? 0 : getReviewerId().hashCode());
        result = prime * result + ((getReviewTime() == null) ? 0 : getReviewTime().hashCode());
        result = prime * result + ((getRejectionReason() == null) ? 0 : getRejectionReason().hashCode());
        result = prime * result + ((getApprovedPatternId() == null) ? 0 : getApprovedPatternId().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        result = prime * result + ((getPatternRole() == null) ? 0 : getPatternRole().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", uploadTime=").append(uploadTime);
        sb.append(", name=").append(name);
        sb.append(", type=").append(type);
        sb.append(", region=").append(region);
        sb.append(", difficultyLevel=").append(difficultyLevel);
        sb.append(", culturalMeaning=").append(culturalMeaning);
        sb.append(", historicalBackground=").append(historicalBackground);
        sb.append(", craftProcess=").append(craftProcess);
        sb.append(", uploadedFilePath=").append(uploadedFilePath);
        sb.append(", reviewStatus=").append(reviewStatus);
        sb.append(", reviewerId=").append(reviewerId);
        sb.append(", reviewTime=").append(reviewTime);
        sb.append(", rejectionReason=").append(rejectionReason);
        sb.append(", approvedPatternId=").append(approvedPatternId);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", patternRole=").append(patternRole);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}